/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gradesjunit;

/**
 *
 * @author x00104195
 */
public class GradesJUnit 
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       

    }
    
    public static String grade(int exam, int ca) {
        String grade = new String();
        grade = "Invalid Input";
        if (exam < 40 || ca < 40) {
            grade = "Component Fail";
        } else {
            int combined = (60 * exam + 40 * ca) / 100;
            if (combined < 60) {
                grade = "Fail";
            } else if (combined >= 60 && combined <= 80) {
                grade = "Pass";
            } else if (combined > 80 && combined < 100) {
                grade = "Pass with Distinction";
            }
        }
        return grade;
    }

    public static String computeFine(String vehicle, int speed, int zone) {

        String fine = new String();

        if (vehicle.equalsIgnoreCase("car")) {
            if (speed > 50 && zone == 30) {
                fine = "EUR30";
            }
            if (speed > 65 && zone == 30) {
                fine = "EUR80";
            }
            if (speed > 60 && zone == 50) {
                fine = "EUR95";
            }
        } else if (vehicle.equalsIgnoreCase("bus")) {
            if (speed > 50 && zone == 30) {
                fine = "EUR30";
            }
        }
        return fine;
    }
    
}
